﻿using DelonixRegiaHotel.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace DelonixRegiaHotel
{
    public partial class DeleteAdmin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnAdmin_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("~/Admin.aspx");
        }

        protected void btnCheckIn_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("~/CheckIn.aspx");
        }

        protected void btnCheckOut_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("~/CheckOut.aspx");
        }

        protected void btnQuery_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("~/Query.aspx");
        }

        protected void btnBooking_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("~/RoomAvailability.aspx");
        }

        protected void btnRates_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("~/Rates.aspx");
        }

        protected void btnStaff_Click(object sender, ImageClickEventArgs e)
        {

        }

        protected void btnReport_Click(object sender, ImageClickEventArgs e)
        {

        }

        protected void btnLogout_Click(object sender, ImageClickEventArgs e)
        {

        }

        protected void btnLogo_Click(object sender, ImageClickEventArgs e)
        {

        }

        protected void btnDeleteAdmin_Click(object sender, EventArgs e)
        {
            string username = lblUsername.Text;
            int status = DBManager.deleteAdmin(username);
            if (status > 0)
            {
                lblStatus.Text = "Admin Has Been Successfully Deleted!";
            }
            else
            {
                lblStatus.Text = "Admin Has Not Been Successfully Deleted!";
            }
        }

        protected void btnRetrieveAdmin_Click(object sender, EventArgs e)
        {
            HotelUser u = DBManager.GetUserByName(tbxRetrieveAdminName.Text);
            lblUsername.Text = u.Username;
            lblPassword.Text = u.Password;
            lblrank.Text = u.Rank;
            lblname.Text = u.Name;
            lblbankaccountnum.Text = u.Bank_account_number;
            lblhomeaddress.Text = u.Home_address;
            lbltelno.Text = u.Tel_num;
            lbldob.Text = u.Date_of_birth;
        }
    }
}